"""CreateAdminRoleTable Migration."""

from masoniteorm.migrations import Migration


class CreateAdminRoleTable(Migration):
    def up(self):
        """
        Run the migrations.
        """
        with self.schema.create("admin_roles") as table:
            table.table_comment('角色')
            table.increments("id")
            table.string('title', 50, False).comment('标题')

            table.timestamps()
            table.unique('title', 'uni_title')

    def down(self):
        """
        Revert the migrations.
        """
        self.schema.drop("admin_roles")
